/*
 Navicat Premium Data Transfer

 Source Server         : localhost
 Source Server Type    : MySQL
 Source Server Version : 50634
 Source Host           : localhost
 Source Database       : teamJDI

 Target Server Type    : MySQL
 Target Server Version : 50634
 File Encoding         : utf-8

 Date: 02/09/2021 20:42:30 PM
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
--  Table structure for `task_degrees`
-- ----------------------------
DROP TABLE IF EXISTS `task_degrees`;
CREATE TABLE `task_degrees` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(32) DEFAULT NULL COMMENT '名称',
  `color` varchar(16) DEFAULT NULL COMMENT '表示颜色',
  `degree` int(8) DEFAULT NULL COMMENT '程度分值',
  `accept_deferred` tinyint(1) DEFAULT '1' COMMENT '是否接受延期',
  `enabled` tinyint(1) DEFAULT NULL COMMENT '是否可用',
  `comment` text COMMENT '备注',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8 COMMENT='任务紧急程度表';

-- ----------------------------
--  Records of `task_degrees`
-- ----------------------------
BEGIN;
INSERT INTO `task_degrees` VALUES ('1', '最低级', '#ccc', '0', '1', '1', null), ('2', '正常', '#eee', '1', '1', '1', null), ('3', '稍紧急', '#ddd', '2', '1', '1', null), ('4', '比较紧急', '#bbb', '3', '0', '1', null), ('5', '很紧急', '#aaa', '4', '0', '1', null), ('6', '公司顶级任务', '#111', '5', '0', '1', null);
COMMIT;

-- ----------------------------
--  Table structure for `task_states`
-- ----------------------------
DROP TABLE IF EXISTS `task_states`;
CREATE TABLE `task_states` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `code` int(11) DEFAULT NULL COMMENT '任务状态码',
  `content` varchar(255) DEFAULT NULL COMMENT '表示状态含义',
  `enabled` tinyint(1) DEFAULT NULL COMMENT '是否可用',
  `comment` text COMMENT '备注',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8 COMMENT='任务状态表';

-- ----------------------------
--  Records of `task_states`
-- ----------------------------
BEGIN;
INSERT INTO `task_states` VALUES ('1', '100', '新任务', '1', null), ('2', '200', '已接受', '1', null), ('3', '300', '已移交', '1', null), ('4', '400', '已拒绝', '1', null), ('5', '500', '已取消', '1', null), ('6', '600', '快完成', '1', null), ('7', '700', '已完成', '1', null);
COMMIT;

-- ----------------------------
--  Table structure for `tasks`
-- ----------------------------
DROP TABLE IF EXISTS `tasks`;
CREATE TABLE `tasks` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `parent_task_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '上级任务id',
  `content` text NOT NULL COMMENT '任务内容',
  `degree_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '紧急程度id',
  `createor_id` int(11) unsigned DEFAULT NULL COMMENT '创建人id',
  `predecessor_id` int(11) DEFAULT NULL COMMENT '前任负责人id',
  `handler_id` int(11) DEFAULT NULL COMMENT '负责处理人id',
  `start_date` datetime DEFAULT NULL COMMENT '计划开始时间',
  `end_date` datetime DEFAULT NULL COMMENT '计划完成时间',
  `depended_task_id` int(11) DEFAULT NULL COMMENT '依赖任务id',
  `got_deferred_days` float DEFAULT '0' COMMENT '被依赖任务延期天数',
  `delayed_days` float DEFAULT '0' COMMENT '已延期天数(.f)',
  `team_id` int(11) DEFAULT NULL COMMENT '任务所属团队id',
  `created_time` datetime DEFAULT NULL COMMENT '创建时间',
  `updated_time` datetime DEFAULT NULL COMMENT '最新更新时间',
  `finished_time` datetime DEFAULT NULL COMMENT '完成时间',
  `state_code` int(11) DEFAULT NULL COMMENT '状态码',
  `subtask_count` int(8) DEFAULT NULL COMMENT '子任务数',
  `progress` float DEFAULT '0' COMMENT '完成进度(.f)',
  `comment` text COMMENT '备注',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COMMENT='任务表';

-- ----------------------------
--  Records of `tasks`
-- ----------------------------
BEGIN;
INSERT INTO `tasks` VALUES ('1', '0', '测试任务', '1', '1', '0', '1', null, null, '0', '0', '0', '2', null, null, null, '0', '0', '0', '备注');
COMMIT;

-- ----------------------------
--  Table structure for `team_members`
-- ----------------------------
DROP TABLE IF EXISTS `team_members`;
CREATE TABLE `team_members` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `team_id` int(11) DEFAULT NULL COMMENT '团队id',
  `user_id` int(11) DEFAULT NULL COMMENT '用户id',
  `leading` tinyint(1) DEFAULT '0' COMMENT '领导权限',
  `join_date` datetime DEFAULT NULL COMMENT '加入时间',
  `nick` varchar(32) DEFAULT NULL COMMENT '团队中的别名',
  `removed` tinyint(1) DEFAULT '0' COMMENT '是否被移除团队',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COMMENT='团队成员表';

-- ----------------------------
--  Records of `team_members`
-- ----------------------------
BEGIN;
INSERT INTO `team_members` VALUES ('1', '2', '1', '1', '2021-02-08 00:00:00', null, '0'), ('2', '2', '2', '0', '2021-02-08 00:00:00', null, '0'), ('3', '2', '5', '0', '2021-02-08 00:00:00', null, '0');
COMMIT;

-- ----------------------------
--  Table structure for `teams`
-- ----------------------------
DROP TABLE IF EXISTS `teams`;
CREATE TABLE `teams` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(32) DEFAULT NULL COMMENT '名称',
  `nick` varchar(32) DEFAULT NULL COMMENT '昵称(花名)',
  `build_date` datetime DEFAULT NULL COMMENT '组建时间',
  `founder` tinyint(11) DEFAULT NULL COMMENT '创立者用户id',
  `disbanded` bit(1) DEFAULT NULL COMMENT '是否已解散',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COMMENT='团队表';

-- ----------------------------
--  Records of `teams`
-- ----------------------------
BEGIN;
INSERT INTO `teams` VALUES ('1', 'Y市互联网医院团队', '卧槽', '2021-02-08 00:00:00', '3', b'0'), ('2', 'X市平台团队', '瞎搞', '2021-02-08 00:00:00', '5', b'0'), ('3', 'NLP团队', '看不懂', '2021-02-08 00:00:00', '1', null);
COMMIT;

-- ----------------------------
--  Table structure for `users`
-- ----------------------------
DROP TABLE IF EXISTS `users`;
CREATE TABLE `users` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(32) DEFAULT NULL COMMENT '姓名',
  `nick` varchar(32) DEFAULT NULL COMMENT '昵称',
  `phone` varchar(16) DEFAULT NULL COMMENT '电话',
  `password` varchar(512) DEFAULT NULL COMMENT '密码(加密字符串)',
  `join_date` datetime DEFAULT NULL COMMENT '加入时间',
  `enabled` tinyint(1) DEFAULT '1' COMMENT '是否可用',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8 COMMENT='用户表';

-- ----------------------------
--  Records of `users`
-- ----------------------------
BEGIN;
INSERT INTO `users` VALUES ('1', '嗨播', '黄河', '189', null, '2019-07-11 00:00:00', '1'), ('2', '文森', '白肚皮', '777', null, '2020-11-24 00:00:00', '1'), ('3', 'jeck', '老外', '111', null, '2021-02-08 00:00:00', '1'), ('4', '葡萄', '水果', '222', null, '2021-02-08 00:00:00', '1'), ('5', '青牛', '水月', '333', null, '2021-02-08 00:00:00', '1'), ('6', '乙己', '木木', '44', null, '2021-02-08 00:00:00', '1');
COMMIT;

SET FOREIGN_KEY_CHECKS = 1;
